import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

const store = new Vuex.Store({
  state: {
    token: "",
    clientId: "",
    userInfo: {
    },
  },
  mutations: {
    setToken(state, token) {
      state.token = token;
    },
    setClientId(state, clientId) {
      state.clientId = clientId;
    },
    setUserInfo(state, userInfo) {
      state.userInfo = userInfo;
    },
  },
  getters: {
    token(state) {
      return state.token;
    },
    clientId(state) {
      return state.clientId;
    },
    userInfo(state) {
      return state.userInfo;
    },
  },
});

export default store;
